From 7014a3b5bb9a630661a66d440ca43a7ca7bba2d8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 20 Jul 2006 18:07:21 +0000 Subject: [PATCH] Export this privately. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 2006-07-20 Matthias Clasen * gtk/gtkicontheme.h: * gtk/gtkicontheme.c (_gtk_icon_theme_ensure_builtin_cache): Export this privately. * gtk/gtkiconfactory.c (render_fallback_image): And call it here to initialize the builtin cache before using it. (#348063, Diego Pettenò) --- ChangeLog | 10 ++++++++++ ChangeLog.pre-2-10 | 10 ++++++++++ gtk/gtkiconfactory.c | 10 +++++++--- gtk/gtkicontheme.c | 2 +- gtk/gtkicontheme.h | 1 + 5 files changed, 29 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c1e57b9be..83cd8a1303 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-07-20 Matthias Clasen + + * gtk/gtkicontheme.h: + * gtk/gtkicontheme.c (_gtk_icon_theme_ensure_builtin_cache): + Export this privately. + + * gtk/gtkiconfactory.c (render_fallback_image): And call it + here to initialize the builtin cache before using it. (#348063, + Diego Pettenò) + 2006-07-19 Federico Mena Quintero * tests/autotestfilechooser.c (test_black_box): Argh, initialize diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 7c1e57b9be..83cd8a1303 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +2006-07-20 Matthias Clasen + + * gtk/gtkicontheme.h: + * gtk/gtkicontheme.c (_gtk_icon_theme_ensure_builtin_cache): + Export this privately. + + * gtk/gtkiconfactory.c (render_fallback_image): And call it + here to initialize the builtin cache before using it. (#348063, + Diego Pettenò) + 2006-07-19 Federico Mena Quintero * tests/autotestfilechooser.c (test_black_box): Argh, initialize diff --git a/gtk/gtkiconfactory.c b/gtk/gtkiconfactory.c index 55ea92bdea..4c04b93790 100644 --- a/gtk/gtkiconfactory.c +++ b/gtk/gtkiconfactory.c @@ -1566,9 +1566,13 @@ render_fallback_image (GtkStyle *style, if (fallback_source.type == GTK_ICON_SOURCE_EMPTY) { - GdkPixbuf *pixbuf = _gtk_icon_cache_get_icon (_builtin_cache, - GTK_STOCK_MISSING_IMAGE, - "24"); + GdkPixbuf *pixbuf; + + _gtk_icon_theme_ensure_builtin_cache (); + + pixbuf = _gtk_icon_cache_get_icon (_builtin_cache, + GTK_STOCK_MISSING_IMAGE, + "24"); gtk_icon_source_set_pixbuf (&fallback_source, pixbuf); g_object_unref (pixbuf); } diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index cffb892e90..ebfc282a46 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -1129,7 +1129,7 @@ load_themes (GtkIconTheme *icon_theme) priv->last_stat_time = tv.tv_sec; } -static void +void _gtk_icon_theme_ensure_builtin_cache (void) { static gboolean initialized = FALSE; diff --git a/gtk/gtkicontheme.h b/gtk/gtkicontheme.h index 8190806d25..1c607ad580 100644 --- a/gtk/gtkicontheme.h +++ b/gtk/gtkicontheme.h @@ -169,6 +169,7 @@ G_CONST_RETURN gchar *gtk_icon_info_get_display_name (GtkIconInfo *icon_info) /* Non-public methods */ void _gtk_icon_theme_check_reload (GdkDisplay *display); +void _gtk_icon_theme_ensure_builtin_cache (void); G_END_DECLS -- 2.30.2